Optimal. Leaf size=103 \[ \frac {a^{3/2} (3 A+2 B) \tanh ^{-1}\left (\frac {\sqrt {a} \sin (c+d x)}{\sqrt {a+a \cos (c+d x)}}\right )}{d}-\frac {a^2 (A-2 B) \sin (c+d x)}{d \sqrt {a+a \cos (c+d x)}}+\frac {a A \sqrt {a+a \cos (c+d x)} \tan (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.18, antiderivative size = 103, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.121, Rules used = {3054, 3060,
2852, 212} \begin {gather*} \frac {a^{3/2} (3 A+2 B) \tanh ^{-1}\left (\frac {\sqrt {a} \sin (c+d x)}{\sqrt {a \cos (c+d x)+a}}\right )}{d}-\frac {a^2 (A-2 B) \sin (c+d x)}{d \sqrt {a \cos (c+d x)+a}}+\frac {a A \tan (c+d x) \sqrt {a \cos (c+d x)+a}}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 2852
Rule 3054
Rule 3060
Rubi steps
\begin {align*} \int (a+a \cos (c+d x))^{3/2} (A+B \cos (c+d x)) \sec ^2(c+d x) \, dx &=\frac {a A \sqrt {a+a \cos (c+d x)} \tan (c+d x)}{d}+\int \sqrt {a+a \cos (c+d x)} \left (\frac {1}{2} a (3 A+2 B)-\frac {1}{2} a (A-2 B) \cos (c+d x)\right ) \sec (c+d x) \, dx\\ &=-\frac {a^2 (A-2 B) \sin (c+d x)}{d \sqrt {a+a \cos (c+d x)}}+\frac {a A \sqrt {a+a \cos (c+d x)} \tan (c+d x)}{d}+\frac {1}{2} (a (3 A+2 B)) \int \sqrt {a+a \cos (c+d x)} \sec (c+d x) \, dx\\ &=-\frac {a^2 (A-2 B) \sin (c+d x)}{d \sqrt {a+a \cos (c+d x)}}+\frac {a A \sqrt {a+a \cos (c+d x)} \tan (c+d x)}{d}-\frac {\left (a^2 (3 A+2 B)\right ) \text {Subst}\left (\int \frac {1}{a-x^2} \, dx,x,-\frac {a \sin (c+d x)}{\sqrt {a+a \cos (c+d x)}}\right )}{d}\\ &=\frac {a^{3/2} (3 A+2 B) \tanh ^{-1}\left (\frac {\sqrt {a} \sin (c+d x)}{\sqrt {a+a \cos (c+d x)}}\right )}{d}-\frac {a^2 (A-2 B) \sin (c+d x)}{d \sqrt {a+a \cos (c+d x)}}+\frac {a A \sqrt {a+a \cos (c+d x)} \tan (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.33, size = 98, normalized size = 0.95 \begin {gather*} \frac {a \sqrt {a (1+\cos (c+d x))} \sec \left (\frac {1}{2} (c+d x)\right ) \sec (c+d x) \left (\sqrt {2} (3 A+2 B) \tanh ^{-1}\left (\sqrt {2} \sin \left (\frac {1}{2} (c+d x)\right )\right ) \cos (c+d x)+2 (A+2 B \cos (c+d x)) \sin \left (\frac {1}{2} (c+d x)\right )\right )}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(703\) vs.
\(2(93)=186\).
time = 0.36, size = 704, normalized size = 6.83
method | result | size |
default | \(\frac {\sqrt {a}\, \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \left (\left (-6 A \ln \left (\frac {4 a \sqrt {2}\, \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+4 \sqrt {a}\, \sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+8 a}{2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\sqrt {2}}\right ) a -6 A \ln \left (-\frac {4 \left (a \sqrt {2}\, \cos \left (\frac {d x}{2}+\frac {c}{2}\right )-\sqrt {a}\, \sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}-2 a \right )}{2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )-\sqrt {2}}\right ) a -8 B \sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \sqrt {a}-4 B \ln \left (\frac {4 a \sqrt {2}\, \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+4 \sqrt {a}\, \sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+8 a}{2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\sqrt {2}}\right ) a -4 B \ln \left (-\frac {4 \left (a \sqrt {2}\, \cos \left (\frac {d x}{2}+\frac {c}{2}\right )-\sqrt {a}\, \sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}-2 a \right )}{2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )-\sqrt {2}}\right ) a \right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+2 A \sqrt {a}\, \sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+3 A \ln \left (\frac {4 a \sqrt {2}\, \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+4 \sqrt {a}\, \sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+8 a}{2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\sqrt {2}}\right ) a +3 A \ln \left (-\frac {4 \left (a \sqrt {2}\, \cos \left (\frac {d x}{2}+\frac {c}{2}\right )-\sqrt {a}\, \sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}-2 a \right )}{2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )-\sqrt {2}}\right ) a +4 B \sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \sqrt {a}+2 B \ln \left (\frac {4 a \sqrt {2}\, \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+4 \sqrt {a}\, \sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+8 a}{2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\sqrt {2}}\right ) a +2 B \ln \left (-\frac {4 \left (a \sqrt {2}\, \cos \left (\frac {d x}{2}+\frac {c}{2}\right )-\sqrt {a}\, \sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}-2 a \right )}{2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )-\sqrt {2}}\right ) a \right )}{\left (2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )-\sqrt {2}\right ) \left (2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\sqrt {2}\right ) \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {a \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, d}\) | \(704\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 1315 vs.
\(2 (93) = 186\).
time = 0.56, size = 1315, normalized size = 12.77 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.38, size = 172, normalized size = 1.67 \begin {gather*} \frac {{\left ({\left (3 \, A + 2 \, B\right )} a \cos \left (d x + c\right )^{2} + {\left (3 \, A + 2 \, B\right )} a \cos \left (d x + c\right )\right )} \sqrt {a} \log \left (\frac {a \cos \left (d x + c\right )^{3} - 7 \, a \cos \left (d x + c\right )^{2} - 4 \, \sqrt {a \cos \left (d x + c\right ) + a} \sqrt {a} {\left (\cos \left (d x + c\right ) - 2\right )} \sin \left (d x + c\right ) + 8 \, a}{\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )^{2}}\right ) + 4 \, {\left (2 \, B a \cos \left (d x + c\right ) + A a\right )} \sqrt {a \cos \left (d x + c\right ) + a} \sin \left (d x + c\right )}{4 \, {\left (d \cos \left (d x + c\right )^{2} + d \cos \left (d x + c\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: SystemError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.53, size = 149, normalized size = 1.45 \begin {gather*} \frac {\sqrt {2} {\left (8 \, B a \mathrm {sgn}\left (\cos \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {4 \, A a \mathrm {sgn}\left (\cos \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{2 \, \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1} - \sqrt {2} {\left (3 \, A a \mathrm {sgn}\left (\cos \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) + 2 \, B a \mathrm {sgn}\left (\cos \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )\right )} \log \left (\frac {{\left | -2 \, \sqrt {2} + 4 \, \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}}{{\left | 2 \, \sqrt {2} + 4 \, \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}}\right )\right )} \sqrt {a}}{4 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {\left (A+B\,\cos \left (c+d\,x\right )\right )\,{\left (a+a\,\cos \left (c+d\,x\right )\right )}^{3/2}}{{\cos \left (c+d\,x\right )}^2} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________